// Upgrade NOTE: commented out 'float4 unity_LightmapST', a built-in variable
// Upgrade NOTE: commented out 'float4x4 _World2Object', a built-in variable
// Upgrade NOTE: commented out 'sampler2D unity_Lightmap', a built-in variable
// Upgrade NOTE: replaced '_World2Object' with 'unity_WorldToObject'
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
// Upgrade NOTE: replaced tex2D unity_Lightmap with UNITY_SAMPLE_TEX2D

Shader "Legacy Shaders/Transparent/Cutout/VertexLit" {
Properties {
 _Color ("Main Color", Color) = (1,1,1,1)
 _SpecColor ("Spec Color", Color) = (1,1,1,0)
 _Emission ("Emissive Color", Color) = (0,0,0,0)
 _Shininess ("Shininess", Range(0.1,1)) = 0.7
 _MainTex ("Base (RGB) Trans (A)", 2D) = "white" { }
 _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
}
SubShader { 
 LOD 100
 Tags { "QUEUE"="AlphaTest" "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" }
 Pass {
  Tags { "LIGHTMODE"="Vertex" "QUEUE"="AlphaTest" "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" }
  AlphaToMask On
  ColorMask RGB
  GpuProgramID 65703
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)


#define CODE_BLOCK_VERTEX
//uniform float4 unity_LightColor[8];
//uniform float4 unity_LightPosition[8];
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 UNITY_MATRIX_MV;
//uniform float4x4 UNITY_MATRIX_IT_MV;
//uniform float4 glstate_lightmodel_ambient;
uniform float4 _Color;
uniform float4 _SpecColor;
uniform float4 _Emission;
uniform float _Shininess;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
uniform float _Cutoff;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float3 xlv_COLOR1 :COLOR1;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_COLOR0 :COLOR0;
    float3 xlv_COLOR1 :COLOR1;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 tmpvar_1;
    tmpvar_1 = in_v.vertex.xyz;
    float shininess_3;
    float3 specColor_4;
    float3 lcolor_5;
    float3 viewDir_6;
    float3 eyeNormal_7;
    float4 color_8;
    color_8 = float4(0, 0, 0, 1.1);
    float4 tmpvar_9;
    tmpvar_9.w = 1;
    tmpvar_9.xyz = float3(tmpvar_1);
    float3x3 tmpvar_10;
    tmpvar_10[0] = conv_mxt4x4_0(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_10[1] = conv_mxt4x4_1(UNITY_MATRIX_IT_MV).xyz;
    tmpvar_10[2] = conv_mxt4x4_2(UNITY_MATRIX_IT_MV).xyz;
    float3 tmpvar_11;
    tmpvar_11 = normalize(mul(tmpvar_10, in_v.normal));
    eyeNormal_7 = tmpvar_11;
    float3 tmpvar_12;
    tmpvar_12 = normalize(UnityObjectToViewPos(tmpvar_9).xyz);
    viewDir_6 = (-tmpvar_12);
    lcolor_5 = (_Emission.xyz + (_Color.xyz * glstate_lightmodel_ambient.xyz));
    specColor_4 = float3(0, 0, 0);
    shininess_3 = (_Shininess * 128);
    int il_2 = 0;
    while((il_2<8))
    {
        float3 tmpvar_13;
        tmpvar_13 = unity_LightPosition[il_2].xyz;
        float3 dirToLight_14;
        dirToLight_14 = tmpvar_13;
        float3 specColor_15;
        specColor_15 = specColor_4;
        float tmpvar_16;
        tmpvar_16 = max(dot(eyeNormal_7, dirToLight_14), 0);
        float3 tmpvar_17;
        tmpvar_17 = ((tmpvar_16 * _Color.xyz) * unity_LightColor[il_2].xyz);
        if((tmpvar_16>0))
        {
            specColor_15 = (specColor_4 + ((0.5 * clamp(pow(max(dot(eyeNormal_7, normalize((dirToLight_14 + viewDir_6))), 0), shininess_3), 0, 1)) * unity_LightColor[il_2].xyz));
        }
        specColor_4 = specColor_15;
        lcolor_5 = (lcolor_5 + min((tmpvar_17 * 0.5), float3(1, 1, 1)));
        il_2 = (il_2 + 1);
    }
    color_8.xyz = float3(lcolor_5);
    color_8.w = _Color.w;
    specColor_4 = (specColor_4 * _SpecColor.xyz);
    float4 tmpvar_18;
    float4 tmpvar_19;
    tmpvar_19 = clamp(color_8, 0, 1);
    tmpvar_18 = tmpvar_19;
    float3 tmpvar_20;
    float3 tmpvar_21;
    tmpvar_21 = clamp(specColor_4, 0, 1);
    tmpvar_20 = tmpvar_21;
    float4 tmpvar_22;
    tmpvar_22.w = 1;
    tmpvar_22.xyz = float3(tmpvar_1);
    out_v.xlv_COLOR0 = tmpvar_18;
    out_v.xlv_COLOR1 = tmpvar_20;
    out_v.xlv_TEXCOORD0 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_22);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    float4 tmpvar_2;
    tmpvar_2 = tex2D(_MainTex, in_f.xlv_TEXCOORD0);
    col_1.xyz = (tmpvar_2 * in_f.xlv_COLOR0).xyz;
    col_1.xyz = (col_1 * 2).xyz;
    col_1.w = (tmpvar_2.w * in_f.xlv_COLOR0.w);
    if((col_1.w<=_Cutoff))
    {
        discard;
    }
    col_1.xyz = (col_1.xyz + in_f.xlv_COLOR1);
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="VertexLM" "QUEUE"="AlphaTest" "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" }
  AlphaToMask On
  ColorMask RGB
  GpuProgramID 186786
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
// uniform float4 unity_LightmapST;
uniform float4 _MainTex_ST;
// uniform sampler2D unity_Lightmap;
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform float _Cutoff;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 color :COLOR;
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    tmpvar_2 = clamp(in_v.color, 0, 1);
    tmpvar_1 = tmpvar_2;
    float4 tmpvar_3;
    tmpvar_3.w = 1;
    tmpvar_3.xyz = in_v.vertex.xyz;
    out_v.xlv_COLOR0 = tmpvar_1;
    out_v.xlv_TEXCOORD0 = ((in_v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
    out_v.xlv_TEXCOORD1 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_3);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    col_1 = (UNITY_SAMPLE_TEX2D(unity_Lightmap, in_f.xlv_TEXCOORD0) * _Color);
    float4 tmpvar_2;
    tmpvar_2 = tex2D(_MainTex, in_f.xlv_TEXCOORD1);
    col_1.xyz = (tmpvar_2 * col_1).xyz;
    col_1.xyz = (col_1 * 2).xyz;
    col_1.w = (tmpvar_2.w * in_f.xlv_COLOR0.w);
    if((col_1.w<=_Cutoff))
    {
        discard;
    }
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Tags { "LIGHTMODE"="VertexLMRGBM" "QUEUE"="AlphaTest" "IGNOREPROJECTOR"="true" "RenderType"="TransparentCutout" }
  AlphaToMask On
  ColorMask RGB
  GpuProgramID 211008
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"


#define CODE_BLOCK_VERTEX
//uniform float4x4 UNITY_MATRIX_MVP;
// uniform float4 unity_LightmapST;
uniform float4 unity_Lightmap_ST;
uniform float4 _MainTex_ST;
// uniform sampler2D unity_Lightmap;
uniform sampler2D _MainTex;
uniform float4 _Color;
uniform float _Cutoff;
struct appdata_t
{
    float4 vertex :POSITION;
    float4 color :COLOR;
    float4 texcoord :TEXCOORD0;
    float4 texcoord1 :TEXCOORD1;
};

struct OUT_Data_Vert
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float2 xlv_TEXCOORD2 :TEXCOORD2;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float4 xlv_COLOR0 :COLOR0;
    float2 xlv_TEXCOORD0 :TEXCOORD0;
    float2 xlv_TEXCOORD2 :TEXCOORD2;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float4 tmpvar_1;
    float4 tmpvar_2;
    tmpvar_2 = clamp(in_v.color, 0, 1);
    tmpvar_1 = tmpvar_2;
    float4 tmpvar_3;
    tmpvar_3.w = 1;
    tmpvar_3.xyz = in_v.vertex.xyz;
    out_v.xlv_COLOR0 = tmpvar_1;
    out_v.xlv_TEXCOORD0 = ((in_v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
    out_v.xlv_TEXCOORD1 = TRANSFORM_TEX(in_v.texcoord1.xy, unity_Lightmap);
    out_v.xlv_TEXCOORD2 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    out_v.vertex = UnityObjectToClipPos(tmpvar_3);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float4 col_1;
    float4 tmpvar_2;
    tmpvar_2 = UNITY_SAMPLE_TEX2D(unity_Lightmap, in_f.xlv_TEXCOORD0);
    col_1 = (tmpvar_2 * tmpvar_2.w);
    col_1 = (col_1 * 2);
    col_1 = (col_1 * _Color);
    float4 tmpvar_3;
    tmpvar_3 = tex2D(_MainTex, in_f.xlv_TEXCOORD2);
    col_1.xyz = (tmpvar_3 * col_1).xyz;
    col_1.xyz = (col_1 * 4).xyz;
    col_1.w = (tmpvar_3.w * in_f.xlv_COLOR0.w);
    if((col_1.w<=_Cutoff))
    {
        discard;
    }
    out_f.color = col_1;
    return out_f;
}


ENDCG

}
 Pass {
  Name "CASTER"
  Tags { "LIGHTMODE"="SHADOWCASTER" "QUEUE"="AlphaTest" "IGNOREPROJECTOR"="true" "SHADOWSUPPORT"="true" "RenderType"="TransparentCutout" }
  GpuProgramID 27933
CGPROGRAM
//#pragma target 4.0

#pragma vertex vert
#pragma fragment frag

#include "UnityCG.cginc"
#define conv_mxt4x4_0(mat4x4) float4(mat4x4[0].x,mat4x4[1].x,mat4x4[2].x,mat4x4[3].x)
#define conv_mxt4x4_1(mat4x4) float4(mat4x4[0].y,mat4x4[1].y,mat4x4[2].y,mat4x4[3].y)
#define conv_mxt4x4_2(mat4x4) float4(mat4x4[0].z,mat4x4[1].z,mat4x4[2].z,mat4x4[3].z)
#define conv_mxt4x4_3(mat4x4) float4(mat4x4[0].w,mat4x4[1].w,mat4x4[2].w,mat4x4[3].w)


#define CODE_BLOCK_VERTEX
//uniform float4 _WorldSpaceLightPos0;
//uniform float4 unity_LightShadowBias;
//uniform float4x4 UNITY_MATRIX_MVP;
//uniform float4x4 unity_ObjectToWorld;
// uniform float4x4 _World2Object;
//uniform float4x4 unity_MatrixVP;
uniform float4 _MainTex_ST;
uniform sampler2D _MainTex;
uniform float _Cutoff;
uniform float4 _Color;
struct appdata_t
{
    float4 vertex :POSITION;
    float3 normal :NORMAL;
    float4 texcoord :TEXCOORD0;
};

struct OUT_Data_Vert
{
    float2 xlv_TEXCOORD1 :TEXCOORD1;
    float4 vertex :SV_POSITION;
};

struct v2f
{
    float2 xlv_TEXCOORD1 :TEXCOORD1;
};

struct OUT_Data_Frag
{
    float4 color :SV_Target0;
};

OUT_Data_Vert vert(appdata_t in_v)
{
    OUT_Data_Vert out_v;
    float3 vertex_1;
    vertex_1 = in_v.vertex.xyz;
    float4 clipPos_2;
    if((unity_LightShadowBias.z!=0))
    {
        float4 tmpvar_3;
        tmpvar_3.w = 1;
        tmpvar_3.xyz = float3(vertex_1);
        float3 tmpvar_4;
        tmpvar_4 = mul(unity_ObjectToWorld, tmpvar_3).xyz;
        float4 v_5;
        v_5.x = conv_mxt4x4_0(unity_WorldToObject).x;
        v_5.y = conv_mxt4x4_1(unity_WorldToObject).x;
        v_5.z = conv_mxt4x4_2(unity_WorldToObject).x;
        v_5.w = conv_mxt4x4_3(unity_WorldToObject).x;
        float4 v_6;
        v_6.x = conv_mxt4x4_0(unity_WorldToObject).y;
        v_6.y = conv_mxt4x4_1(unity_WorldToObject).y;
        v_6.z = conv_mxt4x4_2(unity_WorldToObject).y;
        v_6.w = conv_mxt4x4_3(unity_WorldToObject).y;
        float4 v_7;
        v_7.x = conv_mxt4x4_0(unity_WorldToObject).z;
        v_7.y = conv_mxt4x4_1(unity_WorldToObject).z;
        v_7.z = conv_mxt4x4_2(unity_WorldToObject).z;
        v_7.w = conv_mxt4x4_3(unity_WorldToObject).z;
        float3 tmpvar_8;
        tmpvar_8 = normalize((((v_5.xyz * in_v.normal.x) + (v_6.xyz * in_v.normal.y)) + (v_7.xyz * in_v.normal.z)));
        float tmpvar_9;
        tmpvar_9 = dot(tmpvar_8, normalize((_WorldSpaceLightPos0.xyz - (tmpvar_4 * _WorldSpaceLightPos0.w))));
        float4 tmpvar_10;
        tmpvar_10.w = 1;
        tmpvar_10.xyz = (tmpvar_4 - (tmpvar_8 * (unity_LightShadowBias.z * sqrt((1 - (tmpvar_9 * tmpvar_9))))));
        clipPos_2 = mul(unity_MatrixVP, tmpvar_10);
    }
    else
    {
        float4 tmpvar_11;
        tmpvar_11.w = 1;
        tmpvar_11.xyz = float3(vertex_1);
        clipPos_2 = UnityObjectToClipPos(tmpvar_11);
    }
    float4 clipPos_12;
    clipPos_12.xyw = clipPos_2.xyw;
    clipPos_12.z = (clipPos_2.z + clamp((unity_LightShadowBias.x / clipPos_2.w), 0, 1));
    clipPos_12.z = lerp(clipPos_12.z, max(clipPos_12.z, (-clipPos_2.w)), unity_LightShadowBias.y);
    out_v.vertex = clipPos_12;
    out_v.xlv_TEXCOORD1 = TRANSFORM_TEX(in_v.texcoord.xy, _MainTex);
    return out_v;
}

#define CODE_BLOCK_FRAGMENT
OUT_Data_Frag frag(v2f in_f)
{
    OUT_Data_Frag out_f;
    float x_1;
    x_1 = ((tex2D(_MainTex, in_f.xlv_TEXCOORD1).w * _Color.w) - _Cutoff);
    if((x_1<0))
    {
        discard;
    }
    out_f.color = float4(0, 0, 0, 0);
    return out_f;
}


ENDCG

}
}
}